
package com.phevos.common.dbpool.exception;

/**
 * Ӧ���쳣�ࡣ�����ض��ڱ�Ӧ�����������⴦�?
 */
public class DBPoolException extends Exception
{
    /**
     * TODO
     */
    private static final long serialVersionUID = -4873151134124957460L;

    private String myMsg = null;

    private int myErrorCode = -1;

    /**
     * ������
     * 
     * @param msg ����������ַ���Ϣ��
     */
    public DBPoolException(String msg)
    {
        super(msg);
        myMsg = msg;        
    }
    
    public DBPoolException(String msg,Throwable t)
    {
        super(msg,t);
        myMsg = msg;     
    }

    /**
     * ������
     * 
     * @param errorCode ��ʾ����Ĵ��롣
     */
    public DBPoolException(int errorCode)
    {
        myErrorCode = errorCode;
        myMsg = "default DBPoolException";
    }

    /**
     * ������
     * 
     * @param msg ����������ַ���Ϣ��
     * @param errorCode ��ʾ����Ĵ��롣
     */
    public DBPoolException(String msg, int errorCode)
    {
        myMsg = msg;
        myErrorCode = errorCode;
    }

    /**
     * ���ö���ת��Ϊ�ַ��͵�������Ϣ��
     */
    public String toString()
    {
        return myMsg;
    }

    /**
     * ���ظö����������Ϣ��
     */
    public String getMessage()
    {
        return myMsg;
    }
    
    public int getErrorCode()
    {
        return myErrorCode;
    }


    public void setErrorCode(int errorCode)
    {
        myErrorCode = errorCode;
    }

}
